package com.TwinBlade.PicturePassword;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class HomeChooser extends Activity
  implements View.OnClickListener
{
  Button a;
  Button b;
  Button c;
  CheckBox d;
  private PackageManager e;
  private ComponentName f;
  private Context g;
  private List h = new ArrayList();

  private void a()
  {
    ArrayList localArrayList = new ArrayList();
    Intent localIntent = new Intent("android.intent.action.MAIN");
    localIntent.addCategory("android.intent.category.HOME");
    List localList = this.e.queryIntentActivities(localIntent, 0);
    Iterator localIterator;
    if (localList != null)
      localIterator = localList.iterator();
    while (true)
    {
      if (!localIterator.hasNext())
      {
        CharSequence[] arrayOfCharSequence = (CharSequence[])localArrayList.toArray(new CharSequence[localArrayList.size()]);
        AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
        localBuilder.setTitle(getString(2131296403));
        localBuilder.setItems(arrayOfCharSequence, new ah(this)).show();
        return;
      }
      ResolveInfo localResolveInfo = (ResolveInfo)localIterator.next();
      if (localResolveInfo.activityInfo.packageName.equals("com.TwinBlade.PicturePassword"))
        continue;
      try
      {
        ApplicationInfo localApplicationInfo2 = this.e.getApplicationInfo(localResolveInfo.activityInfo.packageName, 0);
        localApplicationInfo1 = localApplicationInfo2;
        ActivityInfo localActivityInfo = localResolveInfo.activityInfo;
        ComponentName localComponentName = new ComponentName(localActivityInfo.applicationInfo.packageName, localActivityInfo.name);
        this.h.add(localComponentName.flattenToString());
        localArrayList.add((String)this.e.getApplicationLabel(localApplicationInfo1));
      }
      catch (Exception localException)
      {
        while (true)
          ApplicationInfo localApplicationInfo1 = null;
      }
    }
  }

  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    default:
      return;
    case 2131230741:
      this.e.setComponentEnabledSetting(this.f, 1, 1);
      Utilities.a = false;
      Intent localIntent = new Intent("android.intent.action.MAIN");
      localIntent.addCategory("android.intent.category.HOME");
      startActivity(localIntent);
      Utilities.a(this, getString(2131296428), 3, true);
      return;
    case 2131230742:
      this.e.setComponentEnabledSetting(this.f, 0, 1);
      return;
    case 2131230740:
    }
    a();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903044);
    this.g = this;
    this.e = getPackageManager();
    this.f = new ComponentName("com.TwinBlade.PicturePassword", "com.TwinBlade.PicturePassword.HomeLauncher");
    this.a = ((Button)findViewById(2131230741));
    this.b = ((Button)findViewById(2131230742));
    this.c = ((Button)findViewById(2131230740));
    this.a.setOnClickListener(this);
    this.b.setOnClickListener(this);
    this.c.setOnClickListener(this);
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    this.d = ((CheckBox)findViewById(2131230738));
    this.d.setChecked(localSharedPreferences.getBoolean("StartOnBoot", true));
    this.d.setOnCheckedChangeListener(new ag(this, localSharedPreferences));
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.HomeChooser
 * JD-Core Version:    0.6.2
 */